import request from '/@/utils/request';
/**
 * sso模块路由
 */
const prefix = '/sso'

/**
 * 登录
 */
export function login(data: object) {
	return request({
		url: prefix + '/login',
		method: 'post',
		data
	})
}

/**
 * 设置进入的企业
 */
export function setEnterprise(enterpriseId: string) {
	return request({
		url: prefix + '/setEnterprise/' + enterpriseId,
		method: 'post'
	})
}

// 获取验证图片  以及token
export function getCaptchaCode(data: object) {
	return request({
		url: prefix + '/captchaCode',
		method: 'post',
		data
	})
}

// 滑动或者点选验证
export function captchaCheck(data: object) {
	return request({
		url: prefix + '/captchaCheck',
		method: 'post',
		data
	})
}

// 手机获取验证码
export function getCode(data: object) {
	return request({
		url: prefix + '/getCode',
		method: 'get',
		params: data
	})
}

// 校验验证码
export function authCode(data: object) {
	return request({
		url: prefix + '/authCode',
		method: 'get',
		params: data
	})
}
// 手机号登录
export function mobileLogin(data: object) {
	return request({
		url: prefix + '/mobileLogin',
		method: 'post',
		data
	})
}

export function isAutoLogin (data: object){
	return request({
		url: prefix+'/isAutoLogin',
		method: 'get',
		params:data
	})
}

// 邀请注册登录
export function registerLogin(data: object) {
	return request({
		url: prefix + '/registerLogin',
		method: 'post',
		data
	})
}

